﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Diagnostics;

namespace HU8.Web.FileExplorer.FileExplorer.WebServices
{
    /// <summary>
    ///PDF2SWF 的摘要说明
    /// </summary>
    public class PDF2SWF
    {
        public PDF2SWF()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }

        public static bool ExecutCmd(string cmd, string args)
        {
            bool Success = false;
            try
            {
                using (Process p = new Process())
                {
                    p.StartInfo.FileName = cmd;
                    p.StartInfo.Arguments = args;
                    p.StartInfo.UseShellExecute = false;
                    p.StartInfo.RedirectStandardOutput = false;
                    p.StartInfo.CreateNoWindow = true;
                    p.Start();
                    p.PriorityClass = ProcessPriorityClass.Normal;
                    p.WaitForExit();

                    while (!p.HasExited)
                    {
                        continue;
                    }
                    //线程等待4s
                    //System.Threading.Thread.Sleep(4000);
                    Success = true;
                }
            }
            catch (Exception ex)
            {
                Success = false;
            }
            return Success;
        }
    }
}